import threading
import os,time

def sub_thread():
    for i in range(3):
        print(f'子线程{threading.current_thread().name}{i}开始执行')
        time.sleep(1)

if __name__ == '__main__':
    print("主线程开始执行")
    thread1 = threading.Thread(target=sub_thread)
    thread2 = threading.Thread(target=sub_thread)
    thread1.start()
    thread2.start()
    thread1.join()
    thread2.join()
    print("主线程执行完毕")